﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace BudgetManager
{
    public partial class BudgetManagerForm : Form
    {
        BudgetCalculator budgetCalculator;
        public BudgetManagerForm()
        {
            InitializeComponent();
        }

        private void CalculateButton_Click(object sender, EventArgs e)
        {
            decimal total = 0.00M;
            string totalOutput = "";
            budgetCalculator = new BudgetCalculator();
            total = budgetCalculator.Calculate(Convert.ToDecimal(monthlyIncomeTextBox.Text), Convert.ToDecimal(rentTextBox.Text), Convert.ToDecimal(utilitiesTextBox.Text), Convert.ToDecimal(internetTextBox.Text), Convert.ToDecimal(cellPhoneTextBox.Text), Convert.ToDecimal(carInsturanceTextBox.Text), Convert.ToDecimal(gasTextBox.Text));
            totalOutput = "$" + Convert.ToString(total);
            netProfitTotalLabel.Text = totalOutput;
        }
    }
}
